<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <#include "/manage/common/head.html" />
</head>
<body>
<!--顶部导航-->
<#include "/manage/common/navbar.html" />
<!--主内容-->
<div class="page-content">
    <!--侧边菜单-->
    <#include "/manage/common/sidebar.html" />
    <!--正文内容-->
    <div class="content-wrapper">
        <div class="container-fluid">
            <div class="content">
                <div class="page-title">
                    <h3>参数配置</h3>
                    <div class="top-action">
                        <div class="search-action">
                            <div class="form-inline">
                                <input type="text" class="form-control" name="txt_query">
                                <button type="button" id="btn_query" class="btn btn-primary">查询</button>
                            </div>
                        </div>
                        <div class="control-action">
                            <a href="${request.contextPath}/manage/config/form" class="btn btn-success">添加参数</a>
                            <a id="btn_refreshCache" href="${request.contextPath}/manage/config/refresh" class="btn btn-warning">刷新缓存</a>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="page-body">

                </div>
                <div class="page-footer">

                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
<script type="text/javascript">
    $(function(){

        getData();

        //查询事件
        $("#btn_query").click(function(){
            getData();
        });

        //刷新缓存事件
        $("#btn_refreshCache").click(function(){
            $.post($(this).attr("href"), function(data){
                alert(data.result);
            });
            return false;
        });
    });

    function getData(curPage){
        var query = $(":input[name='txt_query']").val();
        curPage = curPage || 1;
        $(".page-body").html($loading).load("${request.contextPath}/manage/config/getData", {s: query, curPage: curPage});
    }
</script>